package menu;

import java.util.ArrayList;
import java.util.List;

public class Menu {
    private int order;
    private String name;
    private String action;
    private List<Menu> children=new ArrayList<>();
    private Menu parent;
    public Menu(int order, String name, String action) {
        this(order,name,action,null);
    }

    public Menu(int order, String name, String action, Menu parent) {
        this.order = order;
        this.name = name;
        this.action = action;
        this.parent = parent;
    }
    @Override
    public String toString() {
        return order+"."+name;
    }
    public void addChild(Menu child){
        children.add(child);
    }
    public String getAction() {
        return action;
    }
    public List<Menu> getChildren() {
        return children;
    }
    public Menu getParent() {
        return parent;
    }
}

